package com.zelin.controller;

import com.zelin.pojo.Classes;
import com.zelin.pojo.R;
import com.zelin.service.ClassesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * ------------------------------
 * 功能：
 * 作者：WF
 * 微信：hbxfwf13590332912
 * 创建时间：2021/11/16-9:55
 * ------------------------------
 */
@RestController
@RequestMapping("/classes")
public class ClassesController {
    @Autowired
    private ClassesService classesService;
    //1. 查询所有班级
    @GetMapping("/list")
    public R list(){
        //1.1 查询所有班级列表
        List<Classes> classesList = classesService.findAll();
        //1.2 返回
        return R.ok().data("list",classesList);
    }
}
